Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix containment Y-position when contain is true and pan-zoom is scaled in or out #279

Closed
wants to merge 4 commits into from

Conversation

awartani
Copy link

@awartani awartani commented Oct 6, 2016

We noticed an issue when we used this great library, where if contain: true, the containment dimensions are invalid in case of zoom in/out.

We found a similar issue opened with an excellent example.

Also, the issue is visible in your "Containment within the parent element" demo.

@timmywil
Copy link
Owner

Thanks for the PR! 😃

However, I'm concerned that the X-position code isn't getting the same changes. Why does this only affect the Y-position?

@awartani
Copy link
Author

awartani commented Oct 11, 2016

@timmywil I think X-Position has some issues as well. Unfortunately I didn't take a look at it yet but from general testing I can see a bunch of issues.

I just pushed another fix:

  1. Add a handle to invert, and automatic containment.
  2. Handle container border.

@awartani
Copy link
Author

@timmywil updated the source code to support x-axis position. Please take a look.

I think the code handles this but I don't know the actual cases that this code was written for:

if (this.$parent.css('textAlign') !== 'center' || $.css(this.elem, 'display') !== 'inline') ...

@bil-bas
Copy link

bil-bas commented Mar 5, 2017

I'm using this patch now. Latest version had this bug, so I was using an older one (that had another bug), so now I've got everything working at once. Please pull 🕺

@awartani
Copy link
Author

@timmywil if the test fixed, will you merge this?

@hamoid
Copy link

hamoid commented Jan 21, 2018

Without this fix contain: 'invert' does not work for me.

For instance an image that should move between 0px and -360px instead moves between 180px and -180px. The effect is that the panned image has an empty 180px margin on the top side.

@timmywil timmywil closed this Jul 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants